window.addEventListener('load',function(){
	//产品放大镜效果
	var show_img = document.querySelector('.show_img')
	var mask = document.querySelector('.mask')
	var big = document.querySelector('.big')
	var bigImg = document.querySelector('.bigImg')
	
	show_img.addEventListener('mouseover', function(){
		mask.style.display = 'block'
		big.style.display = 'block'
	})
	show_img.addEventListener('mouseout', function(){
		mask.style.display = 'none'
		big.style.display = 'none'
	})
	
	show_img.addEventListener('mousemove', function(e){
		var x = e.pageX - this.offsetLeft
		var y = e.pageY - this.offsetTop
		
		var maskX = x - mask.offsetWidth / 2
		var maskY = y - mask.offsetHeight / 2
		
		var maskMax = this.offsetWidth - mask.offsetWidth
		
		maskX = maskX < 0 ? 0 : maskX,
		maskX = maskX > maskMax? maskMax : maskX,
		
		maskY = maskY < 0? 0 : maskY,
		maskY = maskY > maskMax ? maskMax : maskY
		
		mask.style.left = maskX + 'px'
		mask.style.top = maskY + 'px'
		
		var hBei = bigImg.offsetHeight / show_img.offsetHeight
		var wBei = bigImg.offsetWidth /show_img.offsetWidth
		
		bigImg.style.left = -maskX * wBei +'px'
		bigImg.style.top = -maskY * hBei + 'px'
	})
	
	
	//产品导航切换栏
	var as = document.querySelectorAll('.details_list .list_fr .fr_title2 a')
	var content =document.querySelectorAll('.title2_content')
		for(i = 0; i < as.length; i++){
			as[i].setAttribute('index', i)
			as[i].onclick =  function(){				
			for(j = 0; j < as.length; j++){
				as[j].className = ''
				content[j].style.display = 'none'
			}
			this.className = 'first'
			var index = this.getAttribute('index')
			content[index].style.display = 'block'
	}
	}
	
	//计数器
	$(function(){
		$('.reckon ')
	})
})